import yaml
def format_yaml(config, key='', con=[]):
    for k in config.keys():
        if isinstance(config.get(k), dict):
            format_yaml(config.get(k), key=f'{key}.{k}' if key != '' else f'{k}', con=con) 
        else:
            con.append((f'{key}.{k}', config.get(k)))

with open('me.yaml', 'r') as f:
    config = yaml.safe_load(f)
    res = []
    format_yaml(config, con=res)
    print(res)
